import React, { useEffect, useState } from 'react';
import AppBar from './AppBar';
import { Avatar, Button, ChakraProvider, FormControl, FormLabel, Switch } from '@chakra-ui/react' 
import { Progress } from '@chakra-ui/react'
import { FluentProvider, webLightTheme } from '@fluentui/react-components';
function App() {
  // console.log(window.ipcRenderer);

  // const [isOpen, setOpen] = useState(false);
  // const [isSent, setSent] = useState(false);
  // const [echo, setEcho] = useState("");
  // const [msg, setMsg] = useState("");
  // const [fromMain, setFromMain] = useState<string | null>(null);

  // const handleToggle = () => {
  //   if (isOpen) {
  //     setOpen(false);
  //     setSent(false);
  //   } else {
  //     setOpen(true);
  //     setFromMain(null);
  //   }
  // };
  // const sendMessageToElectron = () => {
  //   if (window.Main) {
  //     window.Main.sendMessage("Hello I'm from React World");
  //   } else {
  //     setFromMain('You are in a Browser, so no Electron functions are available');
  //   }
  //   setSent(true);
  // };

  // useEffect(() => {
  //   if (isSent && window.Main)
  //     window.Main.on('message', (message: string) => {
  //       setFromMain(message);
  //     });
  // }, [fromMain, isSent]);

  // useEffect(() => {
  //   window.Main.on('echo', (message: string) => {
  //     setEcho(message);
  //   });
  // },[echo])

  return ( 
    <>
      <div>
      <button className="btn btn-active btn-secondary btn-circle">Secondary</button>
      </div>
    </>   
  );
}

export default App;
